<?php
/**
 * Created by PhpStorm.
 * User: zyark
 * Date: 2018/4/13
 * Time: 08:53
 */

namespace app\index\controller;


use app\common\controller\Frontend;
use app\common\utils\Constant;
use app\index\logic\OrderLogic;

class Order extends Frontend
{
    public function ajax_payment_records(){
        $result = $this->check();
        if(!$result['success']){
            return $this->returnJson($result['msg'],$result['code']);
        }
        $data['page_size'] = $this->request->post('page_size');
        $data['page_num'] = $this->request->post('page_number');
        $data['user_id'] = $result['user_id'];
        $logic = new OrderLogic();
        $result = $logic->getPaymentRecords($data);
        return $this->returnJson('',Constant::CODE_SUCCESS,$result);
    }

    public function test(){
        for ($i=0;$i<9;$i++){
            $order['order_sn'] = build_order_no();
            $order['status'] = 1;
            $order['pay_type'] = 0;
            $order['house_property_id'] = 1;
            $order['money'] = 34;
            $order['property_charge'] = 20;
            $order['water_charge'] = 100;
            $order['user_id'] = 4;
            $order['create_time'] = time();
            model('Order')->insert($order);
        }
    }
}